// 常量路由

const Layouts = () => import("@/layout/index.vue");

export const constantRoutes = [
  // 登录
  {
    path: "/login",
    name: "登录",
    component: () => import("@/views/login/index.vue"),
    meta: {
      title: "登录",
      hidden: true,
    },
  },
  // Dashboard
  {
    path: "/",
    component: Layouts,
    redirect: "/Dashboard",
    meta: { title: "Affilliate", icon: "kb", isWhite: true },
    children: [
      {
        path: "/Dashboard",
        component: () => import("@/views/Dashboard/index.vue"),
        name: "Dashboard",
        meta: {
          hidden: false,
          title: "Dashboard",
          icon: "kb",
        },
      },
    ],
  },
  //Affilliate
  {
    path: "/",
    component: Layouts,
    redirect: "/Affilliate",
    meta: { title: "Affilliate", icon: "lm", isWhite: true },
    children: [
      {
        path: "/Affilliate",
        component: () => import("@/views/Affilliate/index.vue"),
        name: "Affilliate",
        meta: { title: "Affilliate", isWhite: true },
      },
    ],
  },
  //My Points
  {
    path: "/",
    component: Layouts,
    redirect: "/MyPoints",
    meta: { title: "MyPoints", icon: "cw", isWhite: true },
    children: [
      {
        path: "/MyPoints",
        component: () => import("@/views/MyPoints/index.vue"),
        name: "MyPoints",
        meta: { title: "MyPoints", isWhite: true },
      },
    ],
  },
  //RFQ
  {
    path: "/",
    component: Layouts,
    redirect: "/RFQ",
    meta: { title: "RFQ", icon: "bj", isWhite: true },
    children: [
      {
        path: "/RFQ",
        component: () => import("@/views/RFQ/index.vue"),
        name: "RFQ",
        meta: { title: "RFQ", isWhite: true },
      },
    ],
  },
  // Order
  {
    path: "/Order",
    name: "Order",
    component: () => import("@/layout/index.vue"),
    meta: {
      title: "Order",
      hidden: false,
      icon: "dd",
      isWhite: true,
    },
    redirect: "/Order",
    children: [
      {
        path: "/Order/ScaleOrder",
        name: "ScaleOrder",
        component: () => import("@/views/Order/ScaleOrder/index.vue"),
        meta: { title: "ScaleOrder", left: "10", isWhite: true },
      },
      {
        path: "/Order/Merchant",
        name: "Merchant",
        component: () => import("@/views/Order/Merchant/index.vue"),
        meta: {
          title: "Merchant",
          left: "10",
          isWhite: true,
        },
      },
      {
        path: "/Order/dom1",
        name: "dom1",
        component: () => import("@/views/Order/dom1/index.vue"),
        meta: { title: "方案1:懒加载", left: "10", isWhite: true },
      },
      {
        path: "/Order/dom2",
        name: "dom2",
        component: () => import("@/views/Order/dom2/index.vue"),
        meta: { title: "方案2:虚拟列表", left: "10", isWhite: true },
      },

      {
        path: "/Order/ScaleOrder/PlaceAnOrder",
        name: "PlaceAnOrder",
        component: () =>
          import("@/views/Order/ScaleOrder/PlaceAnOrder/index.vue"),
        meta: {
          hidden: true,
        },
      },
      {
        path: "/Order/ScaleOrder/PaymentOrder",
        name: "PaymentOrder",
        component: () =>
          import("@/views/Order/ScaleOrder/PaymentOrder/index.vue"),
        meta: {
          hidden: true,
        },
      },
      // OrderDetails
      {
        path: "/Order/ScaleOrder/OrderDetails",
        name: "OrderDetails",
        component: () =>
          import("@/views/Order/ScaleOrder/OrderDetails/index.vue"),
        meta: {
          hidden: true,
        },
      },
      {
        path: "/Order/ScaleOrder/Dispute",
        name: "Dispute",
        component: () => import("@/views/Order/ScaleOrder/Dispute/index.vue"),
        meta: {
          hidden: true,
        },
      },
    ],
  },

  //Automation
  {
    path: "/",
    component: Layouts,
    redirect: "/Automation",
    meta: { title: "Automation", icon: "zdh", isWhite: true },
    children: [
      {
        path: "/Automation",
        component: () => import("@/views/Automation/index.vue"),
        name: "Automation",
        meta: { title: "Automation", isWhite: true },
      },
    ],
  },

  // Products
  {
    path: "/",
    name: "Products",
    component: () => import("@/layout/index.vue"),
    meta: {
      title: "Products",
      hidden: false,
      icon: "cp",
      isWhite: true,
    },
    redirect: "/Products",
    children: [
      {
        path: "/Products/ImporList",
        name: "ImporList",
        component: () => import("@/views/Products/ImporList/index.vue"),
        meta: { title: "ImporList", left: "10", isWhite: true },
      },
      {
        path: "/Products/MyProducts",
        name: "MyProducts",
        component: () => import("@/views/Products/MyProducts/index.vue"),
        meta: {
          title: "My Products",
          left: "10",
          isWhite: true,
        },
      },
    ],
  },

  //FindProducts
  {
    path: "/",
    component: Layouts,
    redirect: "/FindProducts",
    meta: { title: "FindProducts", icon: "zcp", isWhite: true },
    children: [
      {
        path: "/FindProducts",
        component: () => import("@/views/FindProducts/index.vue"),
        name: "FindProducts",
        meta: { title: "FindProducts", isWhite: true },
      },
    ],
  },
  {
    path: "/",
    component: Layouts,
    redirect: "/TechnicalDocument",
    meta: { title: "TechnicalDocument", icon: "sz", isWhite: true },
    children: [
      {
        path: "/TechnicalDocument",
        component: () => import("@/views/TechnicalDocument/index.vue"),
        name: "TechnicalDocument",
        meta: { title: "ScaleOrder前端文档", isWhite: true },
      },
    ],
  },
  // 404 重定向
  {
    path: "/:pathMatch(.*)*",
    redirect: "/404",
    name: "any",
    meta: { title: "任意路由", hidden: true },
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/404/index.vue"),
    meta: { title: "404 not found", hidden: true },
  },
];
